﻿using DataModels.Dto;
using DataModels.Dto.NeighborCircle;
using DataModels.Enums.NeighborCircle;
using Microsoft.AspNetCore.Mvc;
using Services.NeighborCircle;
using System.Reflection.Metadata.Ecma335;
using Utils;

namespace PropertyManagementWebApi.Controllers.NeighborCircle
{
    public class NeighborCircleForumPostController(NeighborCircleForumPostService neighborCircleForumPostService) : BaseController
    {
        protected readonly NeighborCircleForumPostService _neighborCircleForumPostService = neighborCircleForumPostService;


        /// <summary>
        /// 获取话题列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<ResponseModel> GetNeighborCircleForumPostTalk(NeighborCircleForumPostType? PostType, Guid? NeighborCircleForumPostCategoryUUID, Guid? NeighborCircleForumPostCategorySubUUID)
        {
            return await _neighborCircleForumPostService.GetNeighborCircleForumPostTalk(PostType, NeighborCircleForumPostCategoryUUID, NeighborCircleForumPostCategorySubUUID);
        }

        /// <summary>
        /// 获取分类
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<ResponseModel> GetNeighborCircleForumPostCategory(NeighborCircleForumPostType? PostType)
        {
            return await _neighborCircleForumPostService.GetNeighborCircleForumPostCategory(PostType);
        }

        /// <summary>
        /// 获取达人秀活动
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<ResponseModel> GetNeighborCircleForumPostActivities()
        {
            return await _neighborCircleForumPostService.GetNeighborCircleForumPostActivities();
        }

        /// <summary>
        /// 获取帖子列表
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ResponseModel> GetNeighborCircleForumPost([FromQuery] GetNeighborCircleForumPostInfo info)
        {
            return await _neighborCircleForumPostService.GetNeighborCircleForumPost(info);
        }

        /// <summary>
        /// 获取帖子详情
        /// </summary>
        /// <param name="NeighborCircleForumPostUUID"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ResponseModel> GetNeighborCircleForumPostDetail([GeneralRequired] Guid NeighborCircleForumPostUUID)
        {
            return await _neighborCircleForumPostService.GetNeighborCircleForumPostDetail(NeighborCircleForumPostUUID);
        }

        /// <summary>
        /// 获取点赞列表
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ResponseModel> GetNeighborCircleForumPostLikes([FromQuery] GetNeighborCircleForumPostLikesInfo info)
        {
            return await _neighborCircleForumPostService.GetNeighborCircleForumPostLikes(info);
        }

        /// <summary>
        /// 获取评论
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ResponseModel> GetNeighborCircleForumPostComment([FromQuery] GetNeighborCircleForumPostCommentInfo info)
        {
            return await _neighborCircleForumPostService.GetNeighborCircleForumPostComment(info);
        }

        /// <summary>
        /// 帖子点赞/取消点赞
        /// </summary>
        /// <param name="NeighborCircleForumPostUUID"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ResponseModel> NeighborCircleForumPostLike([GeneralRequired] Guid NeighborCircleForumPostUUID)
        {
            return await _neighborCircleForumPostService.NeighborCircleForumPostLike(NeighborCircleForumPostUUID);
        }

        /// <summary>
        /// 评论点赞/取消点赞
        /// </summary>
        /// <param name="NeighborCircleForumPostCommentUUID"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ResponseModel> NeighborCircleForumPostCommentLike([GeneralRequired] Guid NeighborCircleForumPostCommentUUID)
        {
            return await _neighborCircleForumPostService.NeighborCircleForumPostCommentLike(NeighborCircleForumPostCommentUUID);
        }

        /// <summary>
        /// 发布评论
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ResponseModel> CreateNeighborCircleForumPostComment(CreateNeighborCircleForumPostCommentInfo info)
        {
            return await _neighborCircleForumPostService.CreateNeighborCircleForumPostComment(info);
        }

        /// <summary>
        /// 分享次数+1
        /// </summary>
        /// <param name="NeighborCircleForumPostUUID"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ResponseModel> NeighborCircleForumPostShare([GeneralRequired] Guid NeighborCircleForumPostUUID)
        {
            return await _neighborCircleForumPostService.NeighborCircleForumPostShare(NeighborCircleForumPostUUID);
        }

        /// <summary>
        /// 发帖
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ResponseModel> CreateNeighborCircleForumPost(CreateNeighborCircleForumPostInfo info)
        {
            return await _neighborCircleForumPostService.CreateNeighborCircleForumPost(info);
        }

        /// <summary>
        /// 想要/取消想要
        /// </summary>
        /// <param name="NeighborCircleForumPostUUID"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ResponseModel> NeighborCircleForumPostWant([GeneralRequired] Guid NeighborCircleForumPostUUID)
        {
            return await _neighborCircleForumPostService.NeighborCircleForumPostWant(NeighborCircleForumPostUUID);
        }
    }
}
